]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
magnifier: Avoid cursor visibility changes on startup
authorCarlos Garnacho <carlosg@gnome.org>
Wed, 28 Oct 2020 19:29:55 +0000 (20:29 +0100)
committerCarlos Garnacho <carlosg@gnome.org>
Wed, 28 Oct 2020 19:59:07 +0000 (20:59 +0100)
When initializing the shell, we create the magnifier, and (normally)
let it disabled. This still toggles cursor visibility on, which is
not right since there's other considerations to take during
initialization.

Only do this after actual changes to the magnifier state, so
initialization is left unperturbed.

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1486

js/ui/magnifier.js

index eae7bf46428baa6052cf2de8770765634587feb8..036de7f759719d6219f2872d257ee0211ab31608 100644 (file)
@@ -158,20 +158,21 @@ var Magnifier = class Magnifier {
             zoomRegion.setActive(activate);
         });
 
-        if (isActive != activate) {
-            if (activate) {
-                this._updateMouseSprite();
-                this._cursorSpriteChangedId =
-                    this._cursorTracker.connect('cursor-changed',
-                                                this._updateMouseSprite.bind(this));
-                Meta.disable_unredirect_for_display(global.display);
-                this.startTrackingMouse();
-            } else {
-                this._cursorTracker.disconnect(this._cursorSpriteChangedId);
-                this._mouseSprite.content.texture = null;
-                Meta.enable_unredirect_for_display(global.display);
-                this.stopTrackingMouse();
-            }
+        if (isActive === activate)
+            return;
+
+        if (activate) {
+            this._updateMouseSprite();
+            this._cursorSpriteChangedId =
+                this._cursorTracker.connect('cursor-changed',
+                                            this._updateMouseSprite.bind(this));
+            Meta.disable_unredirect_for_display(global.display);
+            this.startTrackingMouse();
+        } else {
+            this._cursorTracker.disconnect(this._cursorSpriteChangedId);
+            this._mouseSprite.content.texture = null;
+            Meta.enable_unredirect_for_display(global.display);
+            this.stopTrackingMouse();
         }
 
         // Make sure system mouse pointer is shown when all zoom regions are